package pl.krzosekm.vehicleregister.backup;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTextField;

import org.jdesktop.application.Action;
import org.jdesktop.application.Application;
import org.jdesktop.application.ApplicationActionMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.layout.GroupLayout;
import org.jdesktop.layout.LayoutStyle;



/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
//@ContextConfiguration(locations = { "classpath:pl/krzosekm/vehicleregister/resources/applicationContext-dao.xml" 
//	  		          , "classpath:pl/krzosekm/vehicleregister/resources/applicationContext-service.xml"})
public class MainPanel2 extends SingleFrameApplication {
	
	private JPanel leftPanel;
	private JLabel jLabel4;
	private JLabel jLabel6;
	private JSplitPane jSplitPane2;
	private DetailsPanel detailsPanel;
	private JButton jButton4;
	private JCheckBox jCheckBox2;
	private HeaderPanel headerPanel1;
	private JCheckBox jCheckBox1;
	private JTextField jTextField3;
	private JLabel jLabel5;
	private JTextField jTextField2;
	private JComboBox jComboBox1;
	private JLabel jLabel3;
	private JTextField jTextField1;
	private JLabel jLabel2;
	private JPanel jPanel3;
	private RepairsTable repairsTable;
	private JScrollPane jScrollPane1;

	
	
//	@Autowired
//	private UserService userService;
//
//	@Override
//    protected void initialize(String[] args) {
//		String[] locations = {"classpath:pl/krzosekm/vehicleregister/resources/applicationContext-service.xml"};
//        ApplicationContext ctx = new FileSystemXmlApplicationContext(locations);
//        userService = (UserService)ctx.getBean("userService");
//        tableModel = new TableModel();
//    }


    @Override
    protected void startup() {
    	{
	    	getMainFrame().setSize(1035, 566);
    	}
    	BorderLayout mainFrameLayout = new BorderLayout();
    	getMainFrame().getContentPane().setLayout(mainFrameLayout);
    	{
    		headerPanel1 = new HeaderPanel();
    		getMainFrame().getContentPane().add(headerPanel1, BorderLayout.NORTH);
    	}
    	{
    		jSplitPane2 = new JSplitPane();
    		getMainFrame().getContentPane().add(jSplitPane2, BorderLayout.CENTER);
    		jSplitPane2.setPreferredSize(new Dimension(1027, 287));
    		{
    			detailsPanel = new DetailsPanel();
    			jSplitPane2.add(detailsPanel, JSplitPane.RIGHT);
    			detailsPanel.setPreferredSize(new java.awt.Dimension(176, 427));
//    			BorderLayout rightPanelLayout = new BorderLayout();
//    			detailsPanel.setLayout(rightPanelLayout);
    			
    			detailsPanel.setPreferredSize(new Dimension(35, 530));
//    			detailsPanel.setSize(100, 530);
    		}
    		{
    			leftPanel = new JPanel();
    			jSplitPane2.add(leftPanel, JSplitPane.LEFT);
    			BorderLayout topPanelLayout = new BorderLayout();
    			leftPanel.setLayout(topPanelLayout);
    			leftPanel.setPreferredSize(new Dimension(899, 85));
    			leftPanel.setSize(900, 530);
    			{
    				jPanel3 = new JPanel();
    				leftPanel.add(jPanel3, BorderLayout.NORTH);
    				GroupLayout jPanel3Layout = new GroupLayout((JComponent)jPanel3);
    				
    				jPanel3.setLayout(jPanel3Layout);
    				jPanel3.setBorder(BorderFactory.createTitledBorder("Filtr"));
    				jPanel3.setPreferredSize(new Dimension(899, 81));
    				{
    					jLabel2 = new JLabel();
    					jLabel2.setName("jLabel2");
    				}
    				{
    					jTextField1 = new JTextField();
    					jTextField1.setName("jTextField1");
    				}
    				{
    					jLabel3 = new JLabel();
    					jLabel3.setName("jLabel3");
    				}
    				{
    					ComboBoxModel jComboBox1Model = 
    						new DefaultComboBoxModel(
    								new String[] { "Item One", "Item Two" });
    					jComboBox1 = new JComboBox();
    					jComboBox1.setModel(jComboBox1Model);
    				}
    				{
    					jTextField2 = new JTextField();
    					jTextField2.setName("jTextField2");
    				}
    				{
    					jLabel4 = new JLabel();
    					jLabel4.setName("jLabel4");
    				}
    				{
    					jLabel5 = new JLabel();
    					jLabel5.setName("jLabel5");
    				}
    				{
    					jTextField3 = new JTextField();
    					jTextField3.setName("jTextField3");
    				}
    				{
    					jCheckBox1 = new JCheckBox();
    					jCheckBox1.setName("jCheckBox1");
    				}
    				{
    					jCheckBox2 = new JCheckBox();
    					jCheckBox2.setName("jCheckBox2");
    				}
    				{
    					jButton4 = new JButton();
    					jButton4.setName("jButton4");
    					jButton4.setAction(getAppActionMap().get("editRepair"));
    				}
    				jPanel3Layout.setHorizontalGroup(jPanel3Layout.createSequentialGroup()
    						.add(jPanel3Layout.createParallelGroup()
    								.add(GroupLayout.LEADING, jLabel2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    								.add(GroupLayout.LEADING, jLabel3, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
    								.addPreferredGap(LayoutStyle.UNRELATED)
    								.add(jPanel3Layout.createParallelGroup()
    										.add(GroupLayout.LEADING, jTextField1, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE)
    										.add(GroupLayout.LEADING, jTextField2, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE))
    										.add(43)
    										.add(jPanel3Layout.createParallelGroup()
    												.add(GroupLayout.LEADING, jLabel4, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    												.add(GroupLayout.LEADING, jLabel5, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
    												.addPreferredGap(LayoutStyle.RELATED)
    												.add(jPanel3Layout.createParallelGroup()
    														.add(GroupLayout.LEADING, jComboBox1, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE)
    														.add(GroupLayout.LEADING, jTextField3, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE))
    														.add(22)
    														.add(jPanel3Layout.createParallelGroup()
    																.add(GroupLayout.LEADING, jCheckBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    																.add(GroupLayout.LEADING, jCheckBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
    																.add(0, 19, Short.MAX_VALUE)
    																.add(jButton4, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE));
    				jPanel3Layout.setVerticalGroup(jPanel3Layout.createSequentialGroup()
    						.add(jPanel3Layout.createParallelGroup(GroupLayout.BASELINE)
    								.add(GroupLayout.BASELINE, jCheckBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    								.add(GroupLayout.BASELINE, jLabel2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    								.add(GroupLayout.BASELINE, jTextField1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    								.add(GroupLayout.BASELINE, jLabel4, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    								.add(GroupLayout.BASELINE, jTextField3, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
    								.addPreferredGap(LayoutStyle.UNRELATED, 1, GroupLayout.PREFERRED_SIZE)
    								.add(jPanel3Layout.createParallelGroup(GroupLayout.BASELINE)
    										.add(GroupLayout.BASELINE, jComboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    										.add(GroupLayout.BASELINE, jLabel3, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    										.add(GroupLayout.BASELINE, jTextField2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    										.add(GroupLayout.BASELINE, jLabel5, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    										.add(GroupLayout.BASELINE, jCheckBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
    										.add(GroupLayout.BASELINE, jButton4, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)));
    			}
    			{
    				jScrollPane1 = new JScrollPane();
    				leftPanel.add(jScrollPane1, BorderLayout.CENTER);
    				jScrollPane1.setPreferredSize(new Dimension(899, 321));
    				repairsTable = new RepairsTable();
    				jScrollPane1.setViewportView(repairsTable);
    				
    			}
    		}
    	}
    	{
    		jLabel6 = new JLabel();
    		getMainFrame().getContentPane().add(jLabel6, BorderLayout.SOUTH);
    		jLabel6.setName("jLabel6");
    		jLabel6.setPreferredSize(new Dimension(1027, 14));
    	}
        show(jSplitPane2);
    }

    public static void main(String[] args) {
        launch(MainPanel2.class, args);
    }
    
	@Action
	public void editRepair() {
//	    List<User> usersList = userService.findAllUsers();
//	    for (User user : usersList) {
//		System.out.println(user.getLogin());
//	    }
	}

//	public void setUserService(UserService userService) {
//	    this.userService = userService;
//	}
//
//	public UserService getUserService() {
//	    return userService;
//	}
	
    /**
    * Returns the action map used by this application.
     * Actions defined using the Action annotation
     * are returned by this method
     */
	private ApplicationActionMap getAppActionMap() {
		return Application.getInstance().getContext().getActionMap(this);
	}

}
